import java.io.*;
import java.net.*;
import java.util.Scanner;

public class ConsumerClient {
    private static final String SERVER_IP = "192.168.43.7";
    private static final int SERVER_PORT = 5000;

    public static void main(String[] args) {
        try (Socket socket = new Socket(SERVER_IP, SERVER_PORT);
             PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
             BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
             Scanner scanner = new Scanner(System.in)) {

            System.out.print("Enter user ID: ");
            String userId = scanner.nextLine();

            System.out.print("Enter payment amount: ");
            double amount = scanner.nextDouble();

            out.println("PAY " + userId + " " + amount);
            String response = in.readLine();
            System.out.println("Server Response: " + response);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
